package org.lcp.gatlingqueue;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

public class Count {

	private static String fileNameRead = "D:\\tmp\\6-12\\aa.txt";
	private static String fileNameWrite = "D:\\tmp\\6-12\\bb.txt";

	public static void main(String[] args) throws IOException {

		List<String> list = new LinkedList<String>();

		File fileRead = new File(fileNameRead);
		File fileWrite = new File(fileNameWrite);
		BufferedReader br = new BufferedReader(new FileReader(fileRead));
		BufferedWriter bw = new BufferedWriter(new FileWriter(fileWrite));
		String value = br.readLine();
		while (value != null) {
			list.add(value);
			value = br.readLine();
		}
		br.close();

		Collections.sort(list);

		for (String v : list) {
			bw.write(v + "\r\n");
		}
		bw.flush();
		bw.close();

	}
}
